home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH4 / 4-1-3.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-11-02  |  1.8 KB  |  61 lines

  1. VERSION 5.00
  2. Begin VB.Form frm4_1_3 
  3.    Caption         =   "Arithmetic"
  4.    ClientHeight    =   2190
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1485
  7.    ClientWidth     =   4080
  8.    BeginProperty Font 
  9.       Name            =   "MS Sans Serif"
  10.       Size            =   8.25
  11.       Charset         =   0
  12.       Weight          =   700
  13.       Underline       =   0   'False
  14.       Italic          =   0   'False
  15.       Strikethrough   =   0   'False
  16.    EndProperty
  17.    LinkTopic       =   "Form1"
  18.    PaletteMode     =   1  'UseZOrder
  19.    ScaleHeight     =   2190
  20.    ScaleWidth      =   4080
  21.    Begin VB.PictureBox picResult 
  22.       Height          =   1335
  23.       Left            =   120
  24.       ScaleHeight     =   1275
  25.       ScaleWidth      =   3795
  26.       TabIndex        =   1
  27.       Top             =   120
  28.       Width           =   3855
  29.    End
  30.    Begin VB.CommandButton cmdAdd 
  31.       Caption         =   "Add Numbers"
  32.       Height          =   375
  33.       Left            =   840
  34.       TabIndex        =   0
  35.       Top             =   1680
  36.       Width           =   2415
  37.    End
  38. Attribute VB_Name = "frm4_1_3"
  39. Attribute VB_GlobalNameSpace = False
  40. Attribute VB_Creatable = False
  41. Attribute VB_PredeclaredId = True
  42. Attribute VB_Exposed = False
  43. Private Sub cmdAdd_Click()
  44.   'Display the sums of several pairs of numbers
  45.   picResult.Cls
  46.   Call ExplainPurpose
  47.   picResult.Print
  48.   Call Add(2, 3)
  49.   Call Add(4, 6)
  50.   Call Add(7, 8)
  51. End Sub
  52. Private Sub Add(num1 As Single, num2 As Single)
  53.   'Display numbers and their sum
  54.   picResult.Print "The sum of"; num1; "and"; num2; "is"; num1 + num2
  55. End Sub
  56. Private Sub ExplainPurpose()
  57.   'Explain the task performed by the program
  58.   picResult.Print "This program displays sentences"
  59.   picResult.Print "identifying pairs of numbers and their sums."
  60. End Sub
  61.